package org.showminifier.web;

import java.util.ArrayList;
import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.IdentityType;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;


import com.google.appengine.api.datastore.Key;
import com.google.appengine.api.datastore.Text;

/**
*
* Show Minifier
* Author: Shihua Ma <beijing.josh@gmail.com>
* Copyright (c) 2010 Shihua Ma
* Licensed under the MIT license.
*
*/

@PersistenceCapable(identityType = IdentityType.APPLICATION)
public class PageContent {
	
	@PrimaryKey
    @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
    private Key key;
	
	@Persistent
	private Text originalContent;
	
	@Persistent
	private Text minifiedContent;
	
	@Persistent(serialized = "true")
	private ArrayList<RequestHTTPHeader> requestHeaders;
	
	
	@Persistent(serialized = "true")
	private ArrayList<ResponseHTTPHeader> responseHeaders;
	
	@Persistent
	private boolean chunked;
	
	@Persistent
	private boolean deflated;
	
	@Persistent
	private String charset;
	
	@Persistent
	private String contentEncoding;
	
	@Persistent
	private String contentType;
	
	@Persistent
	private int originalDeflatedLength = -1;
	
	@Persistent
	private int minifierDefaltedLength = -1;
	
	@Persistent
	private int responseSize = -1;
	
	@Persistent
	private int domDeep = -1;
	
	@Persistent
	private int domNodeLength = -1;
	
	@Persistent
	private int domAverageDeep = -1;

	@Persistent
	private int domMaxDeep = -1;
	
	public Text getOriginalContent() {
		return this.originalContent;
	}

	public void setOriginalContent(Text originalContent) {
		this.originalContent = originalContent;
	}

	public Text getMinifiedContent() {
		return this.minifiedContent;
	}

	public void setMinifiedContent(Text minifiedContent) {
		this.minifiedContent = minifiedContent;
	}

	public ArrayList<RequestHTTPHeader> getRequestHeaders() {
		return this.requestHeaders;
	}

	public void setRequestHeaders(ArrayList<RequestHTTPHeader> requestHeaders) {
		this.requestHeaders = requestHeaders;
	}

	public ArrayList<ResponseHTTPHeader> getResponseHeaders() {
		return this.responseHeaders;
	}

	public void setResponseHeaders(ArrayList<ResponseHTTPHeader> responseHeaders) {
		this.responseHeaders = responseHeaders;
	}

	public boolean isChunked() {
		return this.chunked;
	}

	public void setChunked(boolean chunked) {
		this.chunked = chunked;
	}

	public boolean isDeflated() {
		return this.deflated;
	}

	public void setDeflated(boolean deflated) {
		this.deflated = deflated;
	}

	public String getCharset() {
		return this.charset;
	}

	public void setCharset(String charset) {
		this.charset = charset;
	}

	public String getContentEncoding() {
		return this.contentEncoding;
	}

	public void setContentEncoding(String contentEncoding) {
		this.contentEncoding = contentEncoding;
	}

	public String getContentType() {
		return this.contentType;
	}

	public void setContentType(String contentType) {
		this.contentType = contentType;
	}

	public Key getKey() {
		return this.key;
	}
	
	public void setKey(Key key) {
		this.key = key;
	}
	
	public int getOriginalDeflatedLength() {
		return this.originalDeflatedLength;
	}

	public void setOriginalDeflatedLength(int originalDeflatedLength) {
		this.originalDeflatedLength = originalDeflatedLength;
	}

	public int getMinifierDefaltedLength() {
		return this.minifierDefaltedLength;
	}

	public void setMinifierDefaltedLength(int minifiedDefaltedLength) {
		this.minifierDefaltedLength = minifiedDefaltedLength;
	}

	public int getDomDeep() {
		return this.domDeep;
	}

	public void setDomDeep(int domDeep) {
		this.domDeep = domDeep;
	}

	public int getDomNodeLength() {
		return this.domNodeLength;
	}

	public void setDomNodeLength(int domNodeLength) {
		this.domNodeLength = domNodeLength;
	}

	public int getDomAverageDeep() {
		return this.domAverageDeep;
	}

	public void setDomAverageDeep(int domAverageDeep) {
		this.domAverageDeep = domAverageDeep;
	}

	public int getResponseSize() {
		return this.responseSize;
	}

	public void setResponseSize(int responseSize) {
		this.responseSize = responseSize;
	}

	public int getDomMaxDeep() {
		return this.domMaxDeep;
	}

	public void setDomMaxDeep(int domMaxDeep) {
		this.domMaxDeep = domMaxDeep;
	}	
}
